  var i = 0;
    function loadScript(url) {
       var script= document.createElement('script');
       script.type= 'text/javascript';
       script.src= url;
       script.async = true;
       script.onload = script.onreadystatechange = function(){
              script.onreadystatechange = script.onload = null;
              handler();
       }
       document.head.appendChild(script);
       i++;
    }
    function handler(){
        if(i ==  1){
            loadScript('http://sf-before-after-plugin.googlecode.com/svn/trunk/javascript/jquery-ui-1.8.13.custom.min.js');
        }
        if( i == 2){
            loadScript('http://sf-before-after-plugin.googlecode.com/svn/trunk/javascript/jquery.beforeafter-1.4.min.js');
        }
    }
    function init(){
          loadScript('http://sf-before-after-plugin.googlecode.com/svn/trunk/javascript/jquery-1.7.1.min.js');

    }
    init();
    
  function renderBeforeAfter(container){
    $(container).show();
    $(container).beforeAfter({
        animateIntro:true,
        imagePath:'http://sf-before-after-plugin.googlecode.com/svn/trunk/images/',
        introDuration : 600,
        introPosition : .25,
        showFullLinks : true,
        beforeLinkText: 'Show before image',
        afterLinkText: 'Show after image',
        cursor: 'e-resize',
        enableKeyboard: true,
        dividerColor: '#070'
    });
  }
 window.onload = loadBeforeAfter;
function loadBeforeAfter(){
    var divlist = $(document).find('.beforeafter');
    $(divlist).each(function(index, domEle){
        renderBeforeAfter(domEle);
    })
}